import { fromJS } from 'immutable';

const TabbarReducer = (preState = fromJS({ showBar: true }), action = {}) => {
  // const state = { ...preState };
  const { type } = action;
  switch (type) {
    case 'hide-tabbar':
      // state.showBar = false;
      return preState.set('showBar', false);
    case 'show-tabbar':
      // state.showBar = true;
      return preState.set('showBar', true);
    default:
      return preState;
  }
};

export default TabbarReducer;
